package com.itheima.test;

import com.itheima.dao.CardDao;
import com.itheima.domain.Card;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Test;

import java.util.List;

public class 一对一查询 {
    @Test
    public void testFindAll() throws Exception{
        SqlSession sqlSession = new SqlSessionFactoryBuilder().build(Resources.getResourceAsStream("mybatis-conﬁg.xml")).openSession();

        CardDao cardDao = sqlSession.getMapper(CardDao.class);

        List<Card> all = cardDao.findAll();

        sqlSession.close();

        System.out.println(all);
    }
}
